
    ##############################################################################################
    ### R code to replicate Figures 1, 2, 3, and S1 
    ### The implementation requires "rogue_by_congress.csv". 
    ##############################################################################################

    setwd("C:\\0Jeong\\1_Projects\\Foreign_Policy\\11_Rogue_States\\drafts\\FPA_revision\\replication_material") # change it accordingly

    Data <- read.csv("rogue_by_congress.csv", header=T)
    attach(Data)
    
    year <- seq(from=1991, to=2015, by=2)
    n.year <- length(year)

    
    pdf("figure1.pdf", height=9, width=9)
    par(mfrow=c(2, 1))
    plot(1:n.year, Data$rogue, type='o', col='black', lty=1, pch=21, ylim=c(0, 500), xaxt="n", xlab="Year",ylab="Frequency of Usage")
    points(1:n.year, Data$rogue_state, type='o', col='black', lty=2, pch=22)
    axis(side=1, las=3, at=seq(from=1, to=n.year, by=2), labels=year[seq(from=1, to=n.year, by=2)], cex.axis=.8)
    #abline(h=seq(from=10, to=200, by=10), lty=2)
    legend('topleft', legend=c("Rogue", "Rogue State"), lty=c(1,2), pch=c(21,22), cex=.9)
    title(main="Rogue or Rogue State", font.main=1, cex=1)
    plot(1:n.year, Data$rogue_Cuba, type='o', col='blue', pch=21, lty=1, ylim=c(0, 250), xaxt="n", xlab="Year",ylab="Frequency of Usage")
    points(1:n.year, Data$rogue_Iran, type='o',lty=2, pch=22, col='red')
    points(1:n.year, Data$rogue_Iraq, type='o', lty=3, pch=23, col='grey5')
    points(1:n.year, Data$rogue_NK, type='o', lty=3, pch=24, col='brown')
    points(1:n.year, Data$rogue_Libya, type='o', lty=3, pch=25, col='purple')
    axis(side=1, las=3, at=seq(from=1, to=n.year, by=2), labels=year[seq(from=1, to=n.year, by=2)], cex.axis=.8)
    #abline(h=seq(from=10, to=200, by=10), lty=2)
    legend('topleft', legend=c("Cuba", "Iran", "Iraq", "North Korea", "Libya"), lty=c(1,2,3,4,5), pch=c(21,22,23,24,25), col=c('blue','red','grey5','brown','purple'), cex=.8)
    title(main="By Target Country", font.main=1, cex=1)
    dev.off()


     
    pdf("figure2.pdf", height=8, width=8)
    par(mfrow=c(2, 1))
    plot(1:n.year, 1:n.year, type='n', lty=1, pch=21, col='red', xaxt="n", xlab="", ylab="Number of Votes", ylim=c(0, 20))
    points(1:n.year, Data$sen_cuba_vote, type='o', lty=1, pch=21, col='blue')
    points(1:n.year, Data$sen_iran_vote, type='o', lty=2, pch=22, col='red')
    points(1:n.year, Data$sen_iraq_vote, type='o', lty=3, pch=23, col='grey5')
    points(1:n.year, Data$sen_NK_vote  , type='o', lty=4, pch=24, col='brown')
    points(1:n.year, Data$sen_libya_vote, type='o', lty=5, pch=25, col='purple')
    axis(side=1, las=3, at=seq(from=1, to=n.year, by=1), labels=year[seq(from=1, to=n.year, by=1)], cex.axis=.8)
    legend('topleft', legend=c("Cuba", "Iran", "Iraq", "North Korea", "Libya"), lty=c(1,2,3,4,5), pch=c(21,22,23,24,25), col=c('blue','red','grey5','brown','purple'), cex=.7)
    title(main="Senate",  font.main=1)

    plot(1:n.year, 1:n.year, type='n', lty=1, pch=21, col='red', xaxt="n", xlab="", ylab="Number of Votes", ylim=c(0, 30))
    points(1:n.year, Data$hou_cuba_vote, type='o', lty=1, pch=21, col='blue')
    points(1:n.year, Data$hou_iran_vote, type='o', lty=2, pch=22, col='red')
    points(1:n.year, Data$hou_iraq_vote, type='o', lty=3, pch=23, col='grey5')
    points(1:n.year, Data$hou_NK_vote  , type='o', lty=4, pch=24, col='brown')
    points(1:n.year, Data$hou_libya_vote, type='o', lty=5, pch=25, col='purple')
    axis(side=1, las=3, at=seq(from=1, to=n.year, by=1), labels=year[seq(from=1, to=n.year, by=1)], cex.axis=.8)
    legend('topleft', legend=c("Cuba", "Iran", "Iraq", "North Korea", "Libya"), lty=c(1,2,3,4,5), pch=c(21,22,23,24,25), col=c('blue','red','grey5','brown','purple'), cex=.7)
    title(main="House",  font.main=1)
    dev.off()


    
       
    pdf("figure3.pdf", height=10, width=8)
    par(mfrow=c(3, 1))
    plot(1:n.year, party.diff.AF, type='o', lty=2, col='black', xaxt="n", xlab="", ylab="Average Party Differences", ylim=c(0, .8))
    points(1:n.year, party.diff, type='o', lty=1, col='black')
    axis(side=1, las=3, at=1:n.year, labels=year, cex.axis=.8)
    legend('topleft', legend=c("All Foreign Policy Votes", "Rogue State Votes"), lty=c(2, 1), cex=.8)
    title(main="Average Party Differences - Senate",  font.main=1)
    plot(1:n.year, H_party_diff_AF, type='o', lty=2, col='black', xaxt="n", xlab="", ylab="Average Party Differences", ylim=c(0, .8))
    points(1:n.year, H_party_diff, type='o', lty=1, cex=0.8, col='black')
    axis(side=1, las=3, at=1:n.year, labels=year, cex.axis=.8)
    legend('topleft', legend=c("All Foreign Policy Votes", "Rogue State Votes"), lty=c(2, 1), cex=.8)
    title(main="Average Party Differences - House",  font.main=1)
    plot(1:n.year, voice.vote, type='o', pch=22, lty=2, col='black', xaxt="n", xlab="", ylab="%", ylim=c(0, 100))
    points(1:n.year, H_voice_vote, type='o', pch=21, lty=2, col='black')
    axis(side=1, las=3, at=1:n.year, labels=year, cex.axis=.8)
    legend('topleft', legend=c("Senate", "House"), pch=c(22,21), lty=c(2, 2), cex=.8)
    title(main="Voice Votes (% of All Rogue State Votes)",  font.main=1)
    dev.off()




    pdf("figure_S1.pdf", height=10, width=8)
    par(mfrow=c(3, 1))
    plot(1:n.year, S_vote_FP, type='o', lty=2, col='black', xaxt="n", xlab="", ylab="", ylim=c(0, 200))
    points(1:n.year, S_vote_RS, type='o', lty=1, col='black')
    axis(side=1, las=3, at=1:n.year, labels=year, cex.axis=.8)
    legend('topleft', legend=c("All Foreign Policy Votes", "Rogue State Votes"), lty=c(2, 1), cex=.8)
    title(main="Number of Recorded Votes in the Senate",  font.main=1)

    plot(1:n.year, H_vote_FP, type='o', lty=2, col='black', xaxt="n", xlab="", ylab="", ylim=c(0, 250))
    points(1:n.year, H_vote_RS, type='o', lty=1, col='black')
    axis(side=1, las=3, at=1:n.year, labels=year, cex.axis=.8)
    legend('topleft', legend=c("All Foreign Policy Votes", "Rogue State Votes"), lty=c(2, 1), cex=.8)
    title(main="Number of Recorded Votes in the House",  font.main=1)

    plot(1:n.year, S_vote_percent, type='o', pch=22, lty=1, col='black', xaxt="n", xlab="", ylab="%", ylim=c(0, 15))
    points(1:n.year, H_vote_percent, type='o', pch=21, lty=2, col='black')
    axis(side=1, las=3, at=1:n.year, labels=year, cex.axis=.8)
    legend('topleft', legend=c("Senate", "House"), pch=c(22,21), lty=c(1, 2), cex=.8)
    title(main="Rogue State Votes (% of All Foreign Policy Votes)",  font.main=1)
    dev.off()
     


